﻿using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DotNetFunctionDemo.CommonLib
{
    public class BaiduApi
    {
        public const string BaseUrl = "https://www.baidu.com";
        public static RestClient Client = new RestClient();
        public static string Login()
        {
            Client.BaseUrl = new System.Uri(BaseUrl);
            IRestRequest request = new RestRequest("",Method.GET);
            request.AddParameter("oq", "图书");
            var response = Client.Execute(request);
            return response.Content;
        }
    }
}
